package com.vimi8.chick.plugins.module;

import com.alibaba.weex.plugin.annotation.WeexModule;
import com.taobao.weex.annotation.JSMethod;
import com.taobao.weex.bridge.JSCallback;
import com.taobao.weex.common.WXModule;
import com.vimi8.chick.plugins.event.EventPicture;

@WeexModule(name = "vmPicture", lazyLoad = true)
public class PictureModule extends WXModule {

    @JSMethod(uiThread = true)
    public void pick(String params, JSCallback jsCallback) {
        EventPicture eventPicture = new EventPicture();
        eventPicture.pick(params, mWXSDKInstance.getContext(), jsCallback);
    }

    @JSMethod
    public void qrcode(String params, JSCallback jsCallback){
        EventPicture eventPicture = new EventPicture();
        eventPicture.qrcode(params, mWXSDKInstance.getContext(), jsCallback);
    }

    @JSMethod
    public void camera(String params, JSCallback jsCallback){
        EventPicture eventPicture = new EventPicture();
        eventPicture.camera(params, mWXSDKInstance.getContext(), jsCallback);
    }

    @JSMethod
    public void video(String params, JSCallback jsCallback){
        EventPicture eventPicture = new EventPicture();
        eventPicture.video(params, mWXSDKInstance.getContext(), jsCallback);
    }

    @JSMethod
    public void videoPreview(String params, JSCallback jsCallback){
        EventPicture eventPicture = new EventPicture();
        eventPicture.videoPreview(params, mWXSDKInstance.getContext(), jsCallback);
    }

}
